package com.vd.wmt;

import java.awt.EventQueue;

import javax.swing.UIManager;
import javax.swing.UIManager.LookAndFeelInfo;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.vd.wmt.process.LoadProcess;
import com.vd.wmt.process.SendProcess;
import com.vd.wmt.process.impl.MailSendProcess;
import com.vd.wmt.process.impl.XlsLoadProcess;
import com.vd.wmt.ui.WmtUI;

/**
 * Hello world!
 *
 */
public class App 
{
	private static Log log = LogFactory.getLog(App.class);
    public static void main( String[] args )
    {
        log.info("WageMailTool start.....");
        LoadProcess loadProcess = new XlsLoadProcess();
        SendProcess sendProcess = new MailSendProcess();
        final WmtUI ui= new WmtUI(sendProcess,loadProcess);
        try {
			for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
				if ("Nimbus".equals(info.getName())) {
					UIManager.setLookAndFeel(info.getClassName());
					break;
				}
			}
		} catch (Exception ex) {
			log.error("ui start exception:", ex);
		}
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				ui.setVisible(true);
			}
		});
    }
}
